package common;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateHelper {
	public static String DATE_FORMAT_PATTERN = "yyyy-MM-dd";
	public static String DATETIME_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss";
	private static SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);
	private static SimpleDateFormat dateTimeFormat = new SimpleDateFormat(DATETIME_FORMAT_PATTERN);
	public static String getNowDateTime() {
		return dateTimeFormat.format(currentDate());
	}
	public static String getNowDate() {
		return dateFormat.format(currentDate());
	}

	public static Date currentDate() {
		Calendar cal = Calendar.getInstance();
		return cal.getTime();
	}

	public static void main(String[] args) {
		System.out.println(getNowDate());;
	}
}